/**
	Pulsar engine. Core.
	Additional include file. Base string class (concatenations)

	Copyright (C) 2013-2014 Dmitry Dolgov

	This program is free software; you can redistribute it and/or modify it under the terms of the
	GNU General Public License as published by the Free Software Foundation; either version 2 of
	the License, or (at your option) any later version.

	This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
	without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
	See the GNU General Public License for more details.
*/

namespace pl
{

template<pl_uint32 N> String<N>& operator << (String<N>& lhs, bool rhs)
{
	lhs.append(rhs ? PL_T("true") : PL_T("false"));
	return lhs;
}

template<pl_uint32 N> String<N>& operator << (String<N>& lhs, short rhs)
{
	pl_char buffer[32];
	pl_char *last = _num2str(buffer, rhs, 10);
	lhs.append(buffer, last);
	return lhs;
}

template<pl_uint32 N> String<N>& operator << (String<N>& lhs, unsigned short rhs)
{
	pl_char buffer[32];
	pl_char *last = _num2str(buffer, rhs, 10);
	lhs.append(buffer, last);
	return lhs;
}

template<pl_uint32 N> String<N>& operator << (String<N>& lhs, int rhs)
{
	pl_char buffer[32];
	pl_char *last = _num2str(buffer, rhs, 10);
	lhs.append(buffer, last);
	return lhs;
}

template<pl_uint32 N> String<N>& operator << (String<N>& lhs, unsigned int rhs)
{
	pl_char buffer[32];
	pl_char *last = _num2str(buffer, rhs, 10);
	lhs.append(buffer, last);
	return lhs;
}

template<pl_uint32 N> String<N>& operator << (String<N>& lhs, long rhs)
{
	pl_char buffer[32];
	pl_char *last = _num2str(buffer, rhs, 10);
	lhs.append(buffer, last);
	return lhs;
}

template<pl_uint32 N> String<N>& operator << (String<N>& lhs, unsigned long rhs)
{
	pl_char buffer[32];
	pl_char *last = _num2str(buffer, rhs, 10);
	lhs.append(buffer, last);
	return lhs;
}

template<pl_uint32 N> String<N>& operator << (String<N>& lhs, long long rhs)
{
	pl_char buffer[32];
	pl_char *last = _num2str(buffer, rhs, 10);
	lhs.append(buffer, last);
	return lhs;
}

template<pl_uint32 N> String<N>& operator << (String<N>& lhs, unsigned long long rhs)
{
	pl_char buffer[32];
	pl_char *last = _num2str(buffer, rhs, 10);
	lhs.append(buffer, last);
	return lhs;
}

template<pl_uint32 N> String<N>& operator << (String<N>& lhs, float rhs)
{
	pl_char buffer[32];
	pl_char *last = _num2str(buffer, rhs);
	lhs.append(buffer, last);
	return lhs;
}

template<pl_uint32 N> String<N>& operator << (String<N>& lhs, double rhs)
{
	pl_char buffer[32];
	pl_char *last = _num2str(buffer, rhs);
	lhs.append(buffer, last);
	return lhs;
}

template<pl_uint32 N> String<N>& operator << (String<N>& lhs, long double rhs)
{
	pl_char buffer[32];
	pl_char *last = _num2str(buffer, rhs);
	lhs.append(buffer, last);
	return lhs;
}

template<pl_uint32 N> String<N>& operator << (String<N>& lhs, const void *rhs)
{
	pl_char buffer[32] = PL_T("0x");
	pl_char *last = _num2str(buffer, reinterpret_cast<pl_uintptr>(rhs), 16);
	lhs.append(buffer, last);
	return lhs;
}

template<pl_uint32 N> String<N>& operator << (String<N>& lhs, char rhs)
{
	lhs.append(static_cast<pl_char>(rhs));
	return lhs;
}

template<pl_uint32 N> String<N>& operator << (String<N>& lhs, wchar_t rhs)
{
	lhs.append(static_cast<pl_char>(rhs));
	return lhs;
}

template<pl_uint32 N> String<N>& operator << (String<N>& lhs, const pl_char* rhs)
{
	lhs.append(rhs);
	return lhs;
}

template<pl_uint32 N, pl_uint32 N2> String<N>& operator << (String<N>& lhs, const String<N2>& rhs)
{
	lhs.append(rhs);
	return lhs;
}

template<pl_uint32 N> String<N> operator << (const String<N>& lhs, bool rhs)
{
	String<N> tmp = lhs;
	tmp << rhs;
	return tmp;
}

template<pl_uint32 N> String<N> operator << (const String<N>& lhs, short rhs)
{
	String<N> tmp = lhs;
	tmp << rhs;
	return tmp;
}

template<pl_uint32 N> String<N> operator << (const String<N>& lhs, unsigned short rhs)
{
	String<N> tmp = lhs;
	tmp << rhs;
	return tmp;
}

template<pl_uint32 N> String<N> operator << (const String<N>& lhs, int rhs)
{
	String<N> tmp = lhs;
	tmp << rhs;
	return tmp;
}

template<pl_uint32 N> String<N> operator << (const String<N>& lhs, unsigned int rhs)
{
	String<N> tmp = lhs;
	tmp << rhs;
	return tmp;
}

template<pl_uint32 N> String<N> operator << (const String<N>& lhs, long rhs)
{
	String<N> tmp = lhs;
	tmp << rhs;
	return tmp;
}

template<pl_uint32 N> String<N> operator << (const String<N>& lhs, unsigned long rhs)
{
	String<N> tmp = lhs;
	tmp << rhs;
	return tmp;
}

template<pl_uint32 N> String<N> operator << (const String<N>& lhs, long long rhs)
{
	String<N> tmp = lhs;
	tmp << rhs;
	return tmp;
}

template<pl_uint32 N> String<N> operator << (const String<N>& lhs, unsigned long long rhs)
{
	String<N> tmp = lhs;
	tmp << rhs;
	return tmp;
}

template<pl_uint32 N> String<N> operator << (const String<N>& lhs, float rhs)
{
	String<N> tmp = lhs;
	tmp << rhs;
	return tmp;
}

template<pl_uint32 N> String<N> operator << (const String<N>& lhs, double rhs)
{
	String<N> tmp = lhs;
	tmp << rhs;
	return tmp;
}

template<pl_uint32 N> String<N> operator << (const String<N>& lhs, long double rhs)
{
	String<N> tmp = lhs;
	tmp << rhs;
	return tmp;
}

template<pl_uint32 N> String<N> operator << (const String<N>& lhs, const void *rhs)
{
	String<N> tmp = lhs;
	tmp << rhs;
	return tmp;
}

template<pl_uint32 N> String<N> operator << (const String<N>& lhs, char rhs)
{
	String<N> tmp = lhs;
	tmp << rhs;
	return tmp;
}

template<pl_uint32 N> String<N> operator << (const String<N>& lhs, wchar_t rhs)
{
	String<N> tmp = lhs;
	tmp << rhs;
	return tmp;
}

template<pl_uint32 N> String<N> operator << (const String<N>& lhs, const pl_char* rhs)
{
	String<N> tmp = lhs;
	tmp << rhs;
	return tmp;
}

template<pl_uint32 N, pl_uint32 N2> String<N> operator << (const String<N>& lhs, const String<N2>& rhs)
{
	String<N> tmp = lhs;
	tmp << rhs;
	return tmp;
}

} // namespace pl

//
// End of file 'pulsar_string_cat.h'
//
